#pragma once

#include <afxdb.h>
#include <sql.h>

#include "./DBWrapper/Database.h"
#include "./DBWrapper/Query.h"
#include "./DBWrapper/IError.h"

#include "DBTableUserCL.h"

class DBError:public  IError
{
public:
	void error(Database&,const std::string&) ;
	void error(Database&,Query&,const std::string&) ;
};

class DBManagerCL
{
public:
	DBManagerCL(void);
	virtual ~DBManagerCL(void);

public:
	static DBManagerCL & GetInstance()
	{
		static DBManagerCL instance ;
		return instance ;
	}

public:
	void Initial(std::string dsn_ , std::string userName_ , std::string passWord_) ;
	void Destroy() ;

public:
	DBTableUserCL * GetTableUser() ;

protected:
    Database        * m_pDataBase ;
	DBError         * m_pError    ;

	DBTableUserCL   * m_pTableUser ;
};
